package com.wwwarehouse.resource_center.bean.goods;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Joseph on 2017/9/26.
 *         <p/>
 */

public class PaginationItemOrResourceBean implements Parcelable {

    /**
     * list : [{"id":25081,"name":"测试内容1g3w","picUrl":"测试内容2x85","typeCode":"测试内容cqe7","typeName":"测试内容80d5"}]
     * page : 35321
     * size : 11441
     * total : 68553
     */

    private long page;
    private long size;
    private long total;
    private List<ListBean> list;

    public long getPage() {
        return page;
    }

    public void setPage(long page) {
        this.page = page;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public List<ListBean> getList() {
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }

    public static class ListBean implements Parcelable {
        /**
         * id : 25081
         * name : 测试内容1g3w
         * picUrl : 测试内容2x85
         * typeCode : 测试内容cqe7
         * typeName : 测试内容80d5
         */

        private long ukid;
        private String name;
        private String picUrl;
        private String typeCode="";
        private String typeName;

        public long getUkid() {
            return ukid;
        }

        public void setUkid(long id) {
            this.ukid = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public String getTypeCode() {
            return typeCode;
        }

        public void setTypeCode(String typeCode) {
            this.typeCode = typeCode;
        }

        public String getTypeName() {
            return typeName;
        }

        public void setTypeName(String typeName) {
            this.typeName = typeName;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeLong(this.ukid);
            dest.writeString(this.name);
            dest.writeString(this.picUrl);
            dest.writeString(this.typeCode);
            dest.writeString(this.typeName);
        }

        public ListBean() {
        }

        protected ListBean(Parcel in) {
            this.ukid = in.readLong();
            this.name = in.readString();
            this.picUrl = in.readString();
            this.typeCode = in.readString();
            this.typeName = in.readString();
        }

        public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
            @Override
            public ListBean createFromParcel(Parcel source) {
                return new ListBean(source);
            }

            @Override
            public ListBean[] newArray(int size) {
                return new ListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.page);
        dest.writeLong(this.size);
        dest.writeLong(this.total);
        dest.writeList(this.list);
    }

    public PaginationItemOrResourceBean() {
    }

    protected PaginationItemOrResourceBean(Parcel in) {
        this.page = in.readLong();
        this.size = in.readLong();
        this.total = in.readLong();
        this.list = new ArrayList<ListBean>();
        in.readList(this.list, ListBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<PaginationItemOrResourceBean> CREATOR = new Parcelable.Creator<PaginationItemOrResourceBean>() {
        @Override
        public PaginationItemOrResourceBean createFromParcel(Parcel source) {
            return new PaginationItemOrResourceBean(source);
        }

        @Override
        public PaginationItemOrResourceBean[] newArray(int size) {
            return new PaginationItemOrResourceBean[size];
        }
    };
}
